/**
 * Data Analyst Skill
 * 
 * A skill for data analysis tasks including file reading, processing, and visualization
 */

import type { Skill } from '../skill-manager';
import {
  readFileTool,
  listDirectoryTool,
  searchFilesTool,
} from '@/tools/builtin/file-tools';
import {
  executeJavaScriptTool,
  executePythonTool,
} from '@/tools/builtin/code-execution';
import { calculatorTool, advancedCalculatorTool } from '@/tools/builtin/calculator';

export const dataAnalystSkill: Skill = {
  id: 'data-analyst',
  name: 'Data Analyst',
  description: 'Analyze data from files, perform calculations, and generate insights',
  category: 'data_analysis',
  version: '1.0.0',
  author: 'CAgent Team',
  
  tools: [
    readFileTool,
    listDirectoryTool,
    searchFilesTool,
    executeJavaScriptTool,
    executePythonTool,
    calculatorTool,
    advancedCalculatorTool,
  ],
  
  systemPrompt: `You are a data analyst assistant with access to file reading, code execution, and calculation tools.

Your capabilities include:
- Reading and analyzing data files (CSV, JSON, text files)
- Performing statistical calculations
- Executing Python or JavaScript code for data processing
- Searching for files in directories
- Generating insights and visualizations

When analyzing data:
1. First, read the data file to understand its structure
2. Perform necessary calculations or transformations
3. Provide clear insights and recommendations
4. If needed, generate code to process or visualize the data

Always explain your analysis process and findings clearly.`,

  examples: [
    {
      title: 'Analyze CSV file',
      description: 'Read and analyze a CSV file containing sales data',
      input: 'Analyze the sales data in data/sales.csv and provide insights',
      expectedOutput: 'I\'ll read the file, calculate key metrics like total sales, average order value, and identify trends.',
    },
    {
      title: 'Statistical analysis',
      description: 'Perform statistical analysis on a dataset',
      input: 'Calculate the mean, median, and standard deviation of the values in data.json',
      expectedOutput: 'I\'ll read the JSON file, extract the values, and calculate the requested statistics.',
    },
  ],
  
  metadata: {
    tags: ['data', 'analysis', 'statistics', 'files'],
    difficulty: 'intermediate',
    estimatedSetupTime: '1 minute',
  },
};

